import { ApiProperty } from '@nestjs/swagger';
import { IsNotEmpty, MaxLength } from 'class-validator';

export class LoginUserDto {
  @ApiProperty({ description: '用户名', required: true })
  @IsNotEmpty({
    message: '用户名不能为空',
  })
  username: string;

  @ApiProperty({ description: '密码', required: true })
  @IsNotEmpty({
    message: '密码不能为空',
  })
  password: string;

  @ApiProperty({ description: '验证码', required: true })
  @IsNotEmpty({
    message: '图形验证码不能为空',
  })
  @MaxLength(6, {
    message: '验证码最大6位',
  })
  code: string;
}
